package com.google.code.diffusion;

import android.app.TabActivity;
import android.content.Intent;
import android.content.res.Resources;
import android.os.Bundle;
import android.widget.TabHost;

/** The main activity. It only fucntions as a host for the "new banknote"
 *  and the "statistics" tabs, which both have their own activity.  */
public class DiffusionActivity extends TabActivity {
  /** Called when the activity is first created. */
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);
    
    Resources       resources = getResources();
    TabHost         tab_host  = getTabHost();
    TabHost.TabSpec tab_spec;
    Intent          intent;

    // Create the "new banknote" tab.
    intent = new Intent();
    intent.setClass(this, NewBankNoteActivity.class);
    tab_spec = tab_host.newTabSpec("new_banknote");
    tab_spec.setIndicator(resources.getText(R.string.NewBankNoteTabLabel));
    tab_spec.setContent(intent);
    tab_host.addTab(tab_spec);

    // Create the "status" tab.
    intent = new Intent();
    intent.setClass(this, StatusActivity.class);
    tab_spec = tab_host.newTabSpec("status");
    tab_spec.setIndicator(resources.getText(R.string.StatusTabLabel));
    tab_spec.setContent(intent);
    tab_host.addTab(tab_spec);

    tab_host.setCurrentTab(0);
  }
}